import * as Cesium from 'cesium';

class AirMoveColorLineClass {
  constructor(viewer) {
    this.viewer = viewer
    this.polygonEntities = []
    this.gridCellEntities = []
  }
  drawOnePlane (pos4) {
    const dop = this.viewer.entities.add({
      polygon: {
        hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights(pos4.flat()),
        material: Cesium.Color.GREEN.withAlpha(0.1),
        perPositionHeight: true,
        outline: true,
      }
    })
    this.polygonEntities.push(dop)
  }
  testPos (xyz, str, colorStr = 'GREEN') {
    this.viewer.entities.add({
      position: xyz,
      point: {
        pixelSize: 10, // 点的大小（像素）
        color: Cesium.Color[`${colorStr}`], // 点的颜色
        outlineColor: Cesium.Color.BLACK, // 点的轮廓颜色
        outlineWidth: 2, // 点的轮廓宽度
      },
      label: {
        text: `${str}`, // 标签文本
        font: '14pt sans-serif', // 标签字体
        style: Cesium.LabelStyle.FILL_AND_OUTLINE, // 标签样式
        fillColor: Cesium.Color[`${colorStr}`], // 填充颜色
        outlineColor: Cesium.Color.BLACK, // 轮廓颜色
        outlineWidth: 2, // 轮廓宽度
        verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // 垂直方向对齐方式
        pixelOffset: new Cesium.Cartesian2(0, -10) // 标签位置偏移
      }
    });
  }
}

export default AirMoveColorLineClass;  